package com.jinxin.platform.cdelecinspect.task;

import com.jinxin.platform.cdelecinspect.service.EleinspectTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-01-09
 * @Author: Lingnan
 **/
@Component
@EnableScheduling
@Slf4j
public class ElecinspectAutoTask {
    @Autowired
    private EleinspectTaskService taskService;

    @Scheduled(cron = "0 */5 * * * ?  ")
    public void updateRequireTask( ){
        int count = taskService.closeTaskWhenOutOfTime();
        log.info("关闭"+count+"条过期任务");
    }
}
